#!/usr/bin/env python
import sys
import class_set
import helper

class FollowFriendRecommendationReasonMapper(helper.MapperHelper):
    def mapper(self):
        for line in sys.stdin:
            key, value = self.loader(line)
            left, right = self.split(key)
            if left is not None:
                self.allocator(right, self.join(left, value))
            else:
                self.allocator(key, value)

def main():
    ffrrm = FollowFriendRecommendationReasonMapper()
    ffrrm.mapper()
   

if __name__ == '__main__':
    main()
